import { FC,useContext } from "react";
import { CheckCircleOutline } from 'antd-mobile-icons'
import style from './index.module.scss'
import { infoType } from "@/store/MessageStore";
import classnames from 'classnames/bind'
import { Button, Space } from "antd-mobile";
import Taro from "@tarojs/taro";
import { OutContext } from "@/pages/index";
const CBN = classnames.bind(style)

type ButtonsMessageType = infoType & {
    position: 'left' | 'right',
}

const ButtonsMessage: FC<ButtonsMessageType> = (props) => {
    const { value, type, position, isSuccess = 'false' } = props
    const {TransferToManualLabor} = useContext(OutContext)!
    const TotalCls = {
        'ButtonsMessage': true,
    }
    return <div className={CBN(TotalCls)}>
        <div> {value}</div>
        <div className={CBN('buttons')}>
            <Space>
                <Button size='mini' color='primary' onClick={()=>{
                    TransferToManualLabor()
                }}>
                    转人工
                </Button>
                <Button size='mini' color='primary' onClick={()=>{
                    Taro.makePhoneCall({
                        phoneNumber: '1234567890' // 替换为实际的电话号码
                      }).catch(err => {
                        console.error('拨打电话失败：', err);
                      });
                }}>
                    拨打客服电话
                </Button>
            </Space>
        </div>
    </div>
}




export default ButtonsMessage